<?php
class tbdata_api_request{
	var $app_key = '';
	var $app_secret = '';
	var $api_url = '';
	var $certi_id = '';
	var $certi_token = '';
	function __construct(){
		$this->certi_id = base_certificate::certi_id();
		$this->certi_token = base_certificate::token();
	}
	public function gen_sign($params){
		return strtoupper(md5($this->app_secret.base_certificate::assemble($params).$this->app_secret));
	}
	public function request($params){
        $http = kernel::single('base_httpclient');
        echo $this->net_result = $http->post($this->api_url,$params);
        return json_decode($this->net_result,true);
		
	}
}